package com.seoultour.joel.dao;

import com.seoultour.joel.entity.Location;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
public class LocationDao {
	@Autowired
	private SessionFactory sessionFactory;

	@Transactional
	public List<Location> getLocations() {
		return (List<Location>)sessionFactory.getCurrentSession().createCriteria(Location.class).list();
	}
}
